﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;

namespace TB_WS.Class
{
    public class WX_User_ID
    {
        public static int Insert_WX_User(int Seller_ID, string WX_User)
        {
            string sql = "insert into WX_User_ID values(" + Seller_ID + ",'" + WX_User + "')";
            return Unit.db_Conn.Nonquery(sql);
        }

        public static int Get_WX_User_Count(int Seller_ID, string WX_User)
        {
            string sql = "select count(*) from WX_User_ID where Seller_ID=" + Seller_ID + " and User_ID='" + WX_User+"'";
            return Convert.ToInt32(Unit.db_Conn.scalar(sql));
        }

        public static DataSet Get_WX_User(int Seller_ID)
        {
            string sql = "select * from WX_User_ID where Seller_ID=" + Seller_ID;
            return Unit.db_Conn.select(sql);
        }

        public static int Delete_WX_User(int Seller_ID, string WX_User)
        {
            string sql = "delete from WX_User_ID where Seller_ID=" + Seller_ID + " and User_ID='" + WX_User + "'";
            return Unit.db_Conn.Nonquery(sql);
        }
    }
}
